package cn.wolfcode.shop.service.impl;

import cn.wolfcode.shop.domain.User;
import cn.wolfcode.shop.redis.RedisService;
import cn.wolfcode.shop.redis.key.UserKeyPrefix;
import cn.wolfcode.shop.service.ISeckillUserService;
import cn.wolfcode.shop.service.IUserService;
import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by wolfcode-lanxw
 */
@Service
public class SeckillUserServiceImpl implements ISeckillUserService {
    @Autowired
    private RedisService redisService;
    @Override
    public User getByToken(String token) {
        User user = redisService.get(UserKeyPrefix.USER_TOKEN, token, User.class);
        return user;
    }
}
